
function lazyLoad(fn, threshold = 200) {
    let flag = true

    window.onscroll = function () {
        let srcollHeight = document.documentElement.scrollHeight

        let clientHeight = document.documentElement.clientHeight

        let scrollTop = document.documentElement.scrollTop || document.body.scrollTop

        let m = srcollHeight - scrollTop - clientHeight

        if (m <= threshold) {
            if (flag) {
                flag = false
                fn()
            } else {
                flag = true
            }
        }
    }
}
